package sng.modules.view.components.city.strategy
{
	import flash.events.Event;
	
	import sng.data.info.GlobalInfo;
	import sng.modules.model.vo.BuildingVO;
	import sng.modules.model.vo.UserBuildingVO;
	import sng.modules.view.components.city.logic.unit.BaseBuilding;
	
	/**
	 *固定资产策略 
	 * @author leonliu
	 * 
	 */	
	public class CapitalAssertsStrategy extends Strategy
	{
		public function CapitalAssertsStrategy(building:BaseBuilding, bvo:BuildingVO, userbvo:UserBuildingVO)
		{
			super(building, bvo, userbvo);
		}
		
		public override function clickNormalBuildingStrategy():void
		{
			//砍树
			//1.删除操作
//			Alert.show("确认售出该建筑吗？", "", Alert.YES|Alert.NO, null, alertClickHandler);
//			function alertClickHandler(evt:CloseEvent):void {
//				if (evt.detail == Alert.YES) {
//					city.currentBuilding.destroy();
//				}
//			}	
			m_building.setProgress();
			m_building.progress.addEventListener("progressOver", progressOver, false, 0, true);
			

		}
		
		protected function progressOver(event:Event):void
		{
			GlobalInfo.mainvo.money+= Math.ceil(m_bvo.buildingprice*0.8);
			m_building.dispose();			
		}
	}
}